#include "apue.h"

int main(void) {
    char *ptr;
    size_t size;
    if (chdir("/home/guopeng/adv_unix_program/playground/testdir2/to_p_testdir") < 0)
        err_sys("chdir failed");

    ptr= path_alloc(&size);
    if (getcwd(ptr, size) == NULL)
        err_sys("getcwd failed");

    printf("cwd = %s\n", ptr);
    exit(0);
}
